<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'任务详情'))}
	<div class="frame">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  >
			<input type="hidden" name="id" id="id" value="{$vo.id}">
			<input type="hidden" name="project_id" id="project_id" value="{$vo.project_id}">
			<input type="hidden" id="ajax" name="ajax" value="1">
			<input type="hidden" id="opmode" name="opmode" value="edit">
			<div class="box col-12">
				<label class="input-label" for="name">任务标题*</label>
				<input class="input" type="text" id="name" name="name" value="{$vo.name}" check="required" info="请输入标题">
			</div>
			<div class="box col-12">
				<label class="input-label" for="executor_id">执行人：</label>
				<input type="hidden" id="executor_name" name="executor_name" value="">
				<select class="input" id="executor_id" name="executor_id">
					<option>请选择</option>
					{:fill_option($member_list,$vo['executor_id'])}
				</select>
			</div>
			<div class="box col-12">
				<label class="input-label" for="workload">工作量：</label>
				<input class="input w6" type="text" id="workload" name="workload" value="{$vo.workload}" check="number" info="必须是数字">
			</div>
			<div class="box col-12">
				<label class="input-label" for="end_date">截至日期*：</label>
				<input type="text" id="end_date" value="{$vo.end_date}" name="end_date" readonly="readonly" class="input input-date" >
			</div>
			<foreach name="field_list" val="udf_vo">
				{:widget('user_define_field/edit',array($udf_vo))}
			</foreach>
			<div class="box col-12">
				<label class="input-label" >任务描述：</label>
				<textarea  class="input simple" style="height:200px;" id="content" name="content">{$vo.content}</textarea>
			</div>
			<div class="box col-12">
				<label class="input-label" >附件：</label>
				{:widget('file_upload/edit',array('add_file'=>$vo['task_file'],'task_file'))}
			</div>
			<div class="box col-12">
				<label class="input-label" ></label>
				<a class="btn btn-normal" onclick="save()">保存</a>
				<a class="btn btn-return" onclick="go_return_url()">取消 </a>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'uploader', 'editor'], function() {
			var $ = layui.jquery;
			var fn = {
				save : function() {
					send_form("form_data", "{:url('save_task')}", '{:url("read",array("id"=>$vo["project_id"]))}', function(ret) {
						if (ret.status) {
							layer.msg(ret.info, {
								time : 1200
							}, function() {
								location.href = '{:url("read",array("id"=>$vo["project_id"]))}';
							});
						} else {
							layer.msg(ret.info);
							return false;
						}
					});
				}
			};
			win_exp(fn);
		});

	</script>
</block>